<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<!--引入vue-->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<div id="app">
  <!--  <cpn></cpn>-->
  <cpn1></cpn1>
</div>
<srcipt type="text/x-template" id="cpn">
  <div>
    <h2>我是标题</h2>
    <p>我是cpn</p>
    <p>script标签抽离 注意类型type="text/x-template"</p>
  </div>
</srcipt>
<template id="cpn1">
  <div>
    <h2>我是标题</h2>
    <p>我是内容</p>
    <p>我是cpn1</p>
  </div>
</template>
<script>
  //注册一个全局组件
  Vue.component('cpn', {
    template: '#cpn'
  })

  Vue.component('cpn1', {
    template: '#cpn1'
  })

  const app = new Vue({
    el: "#app",
    data: {
      message: "Hello zk I am Vue !"
    }
  })
</script>
</body>
</html>
